package com.ffws.forestInfo.api;

import com.ffws.base.model.Label;
import com.ffws.base.model.RestResponse;
import com.ffws.forestInfo.model.dto.PlanInformationDto;
import com.ffws.forestInfo.model.dto.TaskInformationDto;
import com.ffws.forestInfo.model.po.PlanDetail;
import com.ffws.forestInfo.model.po.TaskInformation;
import com.ffws.forestInfo.service.ForestInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author JC
 * @description 护林寻视
 * @Date 2023-8-30 13:44
 * @Version 1.0
 */
@RestController
@Api(value = "护林寻视的接口", tags = "护林寻视的接口")
public class ForestInfoController {

    @Autowired
    ForestInfoService forestInfoService;

    @ApiOperation(value = "获取计划信息")
    @GetMapping("/getPlanInfo")
    public RestResponse<PlanInformationDto> getPlanInfo(@RequestParam("tabId") @ApiParam("标签id") Long tabId) {
        return forestInfoService.getPlanInfo(tabId);
    }

    @ApiOperation(value = "获取任务信息")
    @GetMapping("/getTaskInfo")
    public RestResponse<List<TaskInformationDto>> getTaskInfo(@RequestParam("planId") @ApiParam("计划id") Long planId) {
        return forestInfoService.getTaskInfo(planId);
    }

    @ApiOperation(value = "获取任务统计")
    @GetMapping("/getTaskStat")
    public RestResponse<List<Label>> getTaskStat(@RequestParam("planId") @ApiParam("计划id") Long planId) {
        return forestInfoService.getTaskStat(planId);
    }

    @ApiOperation(value = "获取计划详情")
    @GetMapping("/getPlanDetail")
    public RestResponse<List<PlanDetail>> getPlanDetail(@RequestParam("planId") @ApiParam("计划id") Long planId) {
        return forestInfoService.getPlanDetail(planId);
    }

}
